package cn.bluarry.donationuser.util;

import javax.servlet.http.HttpServletRequest;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;

public class Utils {
    public static String requesttoString(HttpServletRequest request){
        Map map=request.getParameterMap();
        StringBuffer buf=new StringBuffer("{");
        for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){
            Map.Entry element = (Map.Entry) iter.next();
            Object strKey = element.getKey();
            String[] strArr = (String[])element.getValue();
            buf.append(strKey+":");
            for (String str : strArr) {
                buf.append(str);
            }
            buf.append(",");
        }

        return buf.append("}").toString();
    }

    public static String getUUID(){
        String uuid= UUID.randomUUID().toString();
        return uuid.toUpperCase();
    }

}
